# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: leon

import json
import logging
import os

from coin2.support.product_info.spot_gdax_v1 import convert_coin1_constants

pi_file = 'data/coin2/product_info/Spot.Gdax.v1.json'
with open(pi_file) as f:
  static_constants = convert_coin1_constants(json.load(f)['product_infos'])

dynamic_constants = {}
if int(os.getenv('USE_DYNAMIC_SYMBOL', 0)):
  try:
    from coin2.support.product_info.spot_gdax_v1 import gen_coin1_constants
    dynamic_constants = gen_coin1_constants()
  except Exception as e:
    logging.error('Failed to use gdax dynamic symbols! %s', e)

quote_currency_list = list(set(
    static_constants.get('quote_currency_list', []) +
    dynamic_constants.get('quote_currency_list', [])))
currency_list = list(set(
    static_constants.get('currency_list', []) +
    dynamic_constants.get('currency_list', [])))
symbol_list = list(set(
    static_constants.get('symbol_list', []) +
    dynamic_constants.get('symbol_list', [])))

active_symbol_list = [
    "BTC-USD",
    "BTC-EUR",
    "BTC-GBP",
    "BCH-USD",
    "BCH-EUR",
    "BCH-GBP",
    "ETC-USD",
    "ETC-EUR",
    "ETC-GBP",
    "ETH-USD",
    "ETH-EUR",
    "ETH-GBP",
    "EOS-USD",
    "EOS-EUR",
    "EOS-GBP",
    "LTC-USD",
    "LTC-EUR",
    "LTC-GBP",
]
